package org.summer.lawyer.handle;

import jakarta.annotation.Resource;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.summer.lawyer.domain.vo.wxuser.WxUserVo;
import org.summer.lawyer.event.WxUserRegisterEvent;
import org.summer.lawyer.service.IMessageService;

/**
 *
 */
@Slf4j
@Getter
@Component
public class WxUserRegisterHandle implements ApplicationListener<WxUserRegisterEvent> {

    @Resource
    private IMessageService messageService;

    private WxUserVo wxUserVo;


    @Async
    @Override
    public void onApplicationEvent(WxUserRegisterEvent event) {
        this.wxUserVo = event.getWxUserVo();
        messageService.wxUserRegisterMsg(wxUserVo);
    }


}
